<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
var  c= console.log ;
$(document).ready(function(e) {
	//var _data 	= $("#elem").data();
	var _data 	= $.extend({},$("#elem").data());
	var _xdata = _data ; // should be a miror object 
	console.log($("#elem").data() );
	_xdata.id = "changes applied back to #elem.data !!!"  ;
	console.log($("#elem").data() );
}) ;
</script>
<div id="elem" data-id="1" data-foo="some data"></div>
